package org.cst8277.ums.nas.listeners;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.utils.Lists;
import org.cst8277.ums.nas.entity.SegmentInfo;

import java.util.List;


@Data
@Slf4j
public class SegmentInfoListener extends AnalysisEventListener<SegmentInfo> {
    private List<SegmentInfo> segmentInfoList = Lists.newArrayList();

    @Override
    public void invoke(SegmentInfo segmentInfo, AnalysisContext analysisContext) {
        log.info("segmentInfo:{}", segmentInfo);
        this.segmentInfoList.add(segmentInfo);
    }


    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        log.info("[网段分配]数据读取完成");
    }
}
